<template>
  <orh-table>
    <Table
        border
      :data="TeacherList"
      :columns="columns1"
      slot="table" :loading="loading"></Table>
  </orh-table>
</template>

<script>
export default {
  components: {},
  data() {
    return {
	  TeacherList: [],
      loading: false,
      listUrl:'api/teacher/v1/teacher/jobcount',
      columns1: [
        {
            title: '男',
            align: 'center',
            key: 'nan',
        },
        {
            title: '女',
            align: 'center',
            key: 'nv',
        },
        {
            title: '民族',
            align: 'center',
            children: [
                {
                    title: '基诺族',
                    key: '基诺族',
                    align: 'center',
                    render: (h, params) => {
                        let cc = params.row.nation.基诺族
                        return h('div',cc);
                    }
                },
                {
                    title: '汉族',
                    key: '汉族',
                    align: 'center',
                    render: (h, params) => {
                        let cc = params.row.nation.汉族
                        return h('div',cc);
                    }
                },
                {
                    title: '蒙古族',
                    key: '蒙古族',
                    align: 'center',
                    render: (h, params) => {
                        let cc = params.row.nation.蒙古族
                        return h('div',cc);
                    }
                },
            ]
        },
        {
            title: '职称',
            align: 'center',
            children: [
                {
                    title: '初级',
                    key: '初级',
                    align: 'center',
                    render: (h, params) => {
                        let cc = params.row.jobtitle.初级
                        return h('div',cc);
                    }
                },
                {
                    title: '中级',
                    key: '中级',
                    align: 'center',
                    render: (h, params) => {
                        let cc = params.row.jobtitle.中级
                        return h('div',cc);
                    }
                },
                {
                    title: '副高级',
                    key: '副高级',
                    align: 'center',
                    render: (h, params) => {
                        let cc = params.row.jobtitle.副高级
                        return h('div',cc);
                    }
                },
                {
                    title: '正高级',
                    key: '正高级',
                    align: 'center',
                    render: (h, params) => {
                        let cc = params.row.jobtitle.正高级
                        return h('div',cc);
                    }
                },
                {
                    title: '中级以下',
                    key: '中级以下',
                    align: 'center',
                    render: (h, params) => {
                        let cc = params.row.jobtitle.中级以下
                        return h('div',cc);
                    }
                },
                {
                    title: '副高级以下',
                    key: '副高级以下',
                    align: 'center',
                    render: (h, params) => {
                        let cc = params.row.jobtitle.副高级以下
                        return h('div',cc);
                    }
                },
                {
                    title: '正高级以下',
                    key: '正高级以下',
                    align: 'center',
                    render: (h, params) => {
                        let cc = params.row.jobtitle.正高级以下
                        return h('div',cc);
                    }
                },
            ]
        },
      ],
    };
  },
  methods: {
    // ==================================================
    // 数据
    // ==================================================
    Information() {
        this.loading=true
        this.$http.get(this.listUrl).then(val => {
            this.TeacherList=[],
            this.TeacherList.push(val.data) 
            this.loading=false
            
        }).catch(err => {
            this.loading=false
        });
    },
  },
  mounted() {
      this.Information()
  }
};
</script>




